package cn.xiaopengstack.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import cn.bugstack.middleware.db.router.annotation.DBRouterStrategy;
import cn.xiaopengstack.infrastructure.persistent.po.RaffleActivityAccount;
import cn.xiaopengstack.infrastructure.persistent.po.RaffleActivityOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author jiangyangang
* @description 针对表【raffle_activity_order(抽奖活动单)】的数据库操作Mapper
* @createDate 2025-06-24 10:49:05
* @Entity cn.xiaopengstack.infrastructure.persistent.po.RaffleActivityOrder
*/
@Mapper
@DBRouterStrategy(splitTable = true)
public interface IRaffleActivityOrderDao {

    /**
     * 插入记录
     * @param raffleActivityOrder
     */
    @DBRouter(key = "userId")
    void insertSelective(RaffleActivityOrder raffleActivityOrder);

    /**
     * 查询用户抽奖订单
     * @param userId
     * @return
     */
    @DBRouter
    List<RaffleActivityAccount> queryRaffleActivityOrderListByUid(@Param("userId") String userId);

    RaffleActivityOrder queryOrderByUserIdAndOrderId(@Param("userId") String userId, @Param("orderId") String orderId);

    @DBRouter
    int updateOrderStatus(RaffleActivityOrder activityOrder);
}




